import requests
from config import url, headers_web,headers_wechat


class TermResource:

    def __int__(self):
        self.url = url
        self.headers = headers_web

    @classmethod
    def get_designat_info(cls, url: str, params=None,headers=headers_web):
        """
        @Summary:获取指定学期信息
        @Description:老师端过程性评价-手动更新使用
        :param url:
        :param params:
        :return:
        """

        pass

    @classmethod
    def modify_info(cls, url: str, params=None,headers=headers_wechat):
        """
        @Summary:获取最近的学期的信息
        @Description:1.小程序管理端-获取学年学期使用,2.web端老师端，学生端，获取学年学期使用
        post
        :param url:
        :param params:
        :return:
        """
        pass

    @classmethod
    def get_recent_info(cls, url: str, params=None,headers=headers_web):
        '''
        @Summary:保存/修改学期
        @Description:云课堂管理端
        :param url:
        :param params:
        :return:
        '''
        pass

    @classmethod
    def get_all_info(cls, url: str, params=None,headers=headers_web):
        '''
        @Summary:获取所有学期信息
        @Description:云学业支持
        :param url:
        :param params:
        :return:
        '''
        pass

    @classmethod
    def save_term(cls, url: str, params=None,headers=headers_web):
        '''
        @Summary:保存学期
        @Description:数据对接使用
        post
        :param url:
        :param params:
        :return:
        '''
        pass

    @classmethod
    def get_fivetermresource(cls, url: str, params=None,headers=headers_web):
        '''
        @Summary:获取当前学期和之前5个学期
        @Description:
        :param url:
        :param params:
        :return:
        '''
        pass

    @classmethod
    def get_nowandlastterm(cls, url: str, params=None,headers=headers_web):
        '''
        @Summary:获取当前学期和上一个学期
        @Description:教学中心实验室预约记录查询调用
        :param url:
        :param params:
        :return:
        '''
        pass

    @classmethod
    def get_nowandlastthreeterm(cls, url: str, params=None,headers=headers_web):
        '''
        @Summary:获取当前和之前最近三个学期
        @Description:
        :param url:
        :param params:
        :return:
        '''
        pass

    @classmethod
    def get_nowornextterm(cls, url: str, params=None,headers=headers_web):
        """
        @Summary:获取当前学期或下一学期
        @Description:数据对接使用
        :param url:
        :param params:
        :return:
        """
        pass

    @classmethod
    def get_nowterm(cls, url: str, params=None,headers=headers_wechat):
        """
        @Summary:获取当前学期
        @Description:小程序使用
        :param url:
        :param params:
        :return:
        """
        url = url + "/courseApi//v1/terms/nowterm"
        r = requests.get(url=url,headers=headers,params=params)
        return r

    @classmethod
    def get_termList(cls, url: str, params=None,headers=headers_web):
        """
        @Summary:获取所有学期信息
        @Description:
        :param url:
        :param params:
        :return:
        """
        pass

    @classmethod
    def get_termResource(cls, url: str, params=None,headers=headers_web):
        """
        @Summary:获取当前学期和下一个学期,默认获取当前学期与下一个
        @Description:
        :param url:
        :param params:
        :return:
        """
        url = url + "/courseApi/v1/terms/termResource"
        r = requests.get(url=url, headers=headers_web, params=params)
        return r

    @classmethod
    def get_termtypes(cls, url: str, params=None,headers=headers_web):
        """
        @Summary:获取学期类型列表
        @Description:
        :param url:
        :param params:
        :return:
        """
        pass

    @classmethod
    def get_weeks(cls, url: str, params=None,headers=headers_wechat):
        """
        @Summary:获取所有周次日期信息
        @Description:小程序周课表查询
        :param url:
        :param params:
        :return:
        """
        pass
if __name__ == '__main__':
    from common.hashlib_utils import hash_md5

    valid_code = hash_md5("&signKey=123123")
    params = {
        "validCode": valid_code
    }
    r = TermResource.get_nowterm(url=url,params=params)
    print(r)